import request from '@/utils/request'
let baseUrl =
  // process.env.NODE_ENV === 'production'
  //   ? 'api/channel'
  //   : 'http://172.16.0.14:8020'
  process.env.NODE_ENV === 'production' ? 'api/channel' : '/channel'
export const getGrantList = (data: any) =>
  request({
    baseURL: baseUrl,
    url: '/manage/asset/grantRecordPageList',
    method: 'post',
    data
  })

export const getAssetDetail = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/manage/asset/getAssetDetail',
    method: 'post',
    data
  })

export const getStatisticsReport = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/manage/report/statistics',
    method: 'post',
    data
  })

export const exportStatistics = (data?: any) =>
  request({
    responseType: 'blob',
    baseURL: baseUrl,
    url: '/manage/report/export',
    method: 'post',
    data
  })

export const uploadEleActionUrl = baseUrl + '/manage/file/upload-files'

export const testUpload = (data?: any) =>
  request({
    headers: {
      'Content-type': 'multipart/form-data'
    },
    baseURL: baseUrl,
    url: '/manage/file/upload-files',
    method: 'post',
    data
  })

export const fileListPage = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/manage/file/list',
    method: 'post',
    data
  })

export const fileDel = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/manage/file/del',
    method: 'post',
    data
  })

export const grantDownFile = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/asset/grant/export',
    method: 'post',
    responseType: 'blob',
    data
  })
